package com.gitee.wsl.mathematics.geometry.d2.contour.segment.ext

import com.gitee.wsl.mathematics.geometry.d2.contour.segment.CurveSegmentShape2D
import com.gitee.wsl.mathematics.geometry.d2.contour.segment.Segment2D
import com.gitee.wsl.mathematics.vector.vec2.Vec2f

fun Segment2D.reduced(stepSize: Double = 0.01): List<CurveSegmentShape2D<Float, Vec2f>> {
    val pass1 = splitOnExtrema()
    //return pass1
    return pass1.flatMap { it.splitToSimple(stepSize) }
}